import request from '@/utils/request'

export default {
  //获取单词类别列表
  getSelectWordList() {
    return request({
      url: `/studyservice/select-word/getSelectWordList`,
      method: 'get'
    })
  },

  //根据等级找出等级名称
  queryGradeNameByGrade(id) {
    return request({
      url: `/studyservice/select-word/queryGradeNameById/` + id,
      method: 'get'
    })
  },
  //根据等级随机查询某个单词
  queryStudyWordByGrade(grade) {
    return request({
      url: `/studyservice/select-word/queryStudyWordByGrade/` + grade,
      method: 'get'
    })
  },
  //根据等级找出相关比例
  progress(grade) {
    return request({
      url: `/studyservice/select-word/progress/` + grade,
      method: 'get'
    })
  },

  //点击记住
  rememberWord(wordId) {
    return request({
      url: `/studyservice/remember-word/rememberWord/` + wordId,
      method: 'get'
    })
  },
  //点击未熟悉
  forgetWord(wordId) {
    return request({
      url: `/studyservice/forget-word/forgetWord/` + wordId,
      method: 'get'
    })
  },
  //点击重新学习
  reLearnWord(grade) {
    return request({
      url: `/studyservice/next-word/reLearnWord/` + grade,
      method: 'get'
    })
  },

  //点击不认识
  unrememberWord(wordId) {
    return request({
      // url: `/studyservice/unremember-word/unrememberWord/` + wordId,
      url: `/studyservice/user-unremember-word/unrememberWord/` + wordId,
      method: 'get'
    })
  },

  //是否已加入收藏夹
  isUserCollectionWord(wordId) {
    return request({
      url: `/studyservice/user-collection-word/isUserCollectionWord/` + wordId,
      method: 'get'
    })
  },

  //加入用户单词收藏夹
  addToFavorites(wordId) {
    return request({
      url: `/studyservice/user-collection-word/addToFavorites/` + wordId,
      method: 'get'
    })
  },
  
  //获取等级列表
  getStudyGradeList() {
    return request({
      url: `/studyservice/study-grade/getStudyGradeList/`,
      method: 'get'
    })
  },

  //获取收藏夹单词列表
  getUserCollectionWordList(grade) {
    return request({
      url: `/studyservice/user-collection-word/getUserCollectionWordList/` + grade,
      method: 'get'
    })
  },

  //删除用户收藏夹单词
  delectUserCollectionWord(wordId) {
    return request({
      url: `/studyservice/user-collection-word/delectUserCollectionWord/` + wordId,
      method: 'delete'
    })
  },

  //获取生词本单词列表
  getUserUnrememberWordList(grade) {
    return request({
      url: `/studyservice/user-unremember-word/getUserUnrememberWordList/` + grade,
      method: 'get'
    })
  },

  //删除用户生词本单词
  delectUserUnrememberWord(wordId) {
    return request({
      url: `/studyservice/user-unremember-word/delectUserUnrememberWord/` + wordId,
      method: 'delete'
    })
  },

  //得到听力类别列表
  getStudyListeningTypeList() {
    return request({
      url: `/studyservice/study-listening-type/getStudyListeningTypeList/`,
      method: 'get'
    })
  },

  //得到听力列表
  getStudyListeningList(typeId) {
    return request({
      url: `/studyservice/study-listening/getStudyListeningList/` + typeId,
      method: 'get'
    })
  },

  //句子翻译功能
  sentenceTranslation(translateSentence) {
    return request({
      url: `/studyservice/translate/sentenceTranslation/`,
      method: 'post',
      data: translateSentence
    })
  },

  //单词词典功能
  wordDictionary(wordName) {
    return request({
      url: `/studyservice/translate/wordDictionary/` + wordName,
      method: 'post'
    })
  },

  //在词典界面加入收藏夹操作
  insertCollectionWordByWD(collectionWord) {
    return request({
      url: `/studyservice/translate/insert/collectionWordByWD/`,
      method: 'post',
      data: collectionWord
    })
  },

  //在词典界面加入生词本操作
  insertUnrememberWordByWD(unrememberWord) {
    return request({
      url: `/studyservice/translate/insert/unrememberWordByWD/`,
      method: 'post',
      data: unrememberWord
    })
  },

  //得到听力内容
  getStudyListening(listeningId) {
    return request({
      url: `/studyservice/study-listening/getStudyListening/` + listeningId,
      method: 'get'
    })
  },

  //查找所有书籍
  getBookList() {
    return request({
      url: `/studyservice/study-reading/getBookList/`,
      method: 'get'
    })
  },

  //条件过滤(书籍或作者)查找书籍
  searchBook(keywords) {
    return request({
      url: `/studyservice/study-reading/searchBook/` + keywords,
      method: 'get'
    })
  },

  //根据书籍id获取书籍信息
  getBookById(bookId) {
    return request({
      url: `/studyservice/study-reading/getBookById/` + bookId,
      method: 'get'
    })
  },

}